﻿#ifndef ConfigOperate_H
#define ConfigOperate_H
#include <QSettings>
#include <QFileInfo>
#include <QDebug>
#include <QString>

#if _MSC_VER >= 1600
#pragma execution_character_set("utf-8")
#endif

class ConfigOperate
{
public:
    ConfigOperate();

    void initSystemInfo();
    void readSystemInfo();
    void writeSystemInfo();

    bool writeInit(QString group, QString key, QString value);
    bool readInit(QString group, QString key, QString &value);
    bool readInit(QString group, QStringList keyList, QStringList &valueList);
    bool writeInit(QString group, QStringList keyList, QStringList valueList);

    void writePort(QString value);
    void writeHouseImagePath(QString value);
    void writeHotelImagePath(QString value);
    void writeCertImagePath(QString value);
    void writeHeadImagePath(QString value);
    void writeLicenseImagePath(QString value);
    void writeCommentImagePath(QString value);
    void writeDataBaseAttribute(QStringList& valueList);
    void writeDataBaseAttribute(QString hostName,QString databaseName,QString userName,QString password);

    QString readPort();
    QString readHostName();
    QString readDatabaseName();
    QString readUserName();
    QString readPassword();
    QStringList readDataBaseAttribute();

    QString readCertImagePath();
    QString readHeadImagePath();
    QString readHouseImagePath();
    QString readHotelImagePath();
    QString readLicenseImagePath();
    QString readCommentImagePath();

private:
    QString m_cfgFile;
    QString m_port;

    QString m_hostName;
    QString m_databaseName;
    QString m_userName;
    QString m_password;

    QString m_commentImagePath;
    QString m_houseImagePath;
    QString m_hotelImagePath;
    QString m_licenseImagePath;
    QString m_headImagePath;
    QString m_certImagePath;

};

#endif // ConfigOperate_H
